package cn.superchart.web.core.handler;

import cn.superchart.common.base.BaseResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class ScGlobalResponseHandler {
    @ResponseBody
    @ExceptionHandler(Exception.class)
    public BaseResult<String> handleException(Exception e) {
        return ScExceptionUtil.convert(e);
    }
}
